<include file="public@header"/>
<link rel="stylesheet" href="/themes/admin_simpleboot3/admin/freight/css/fright_index.css">
</head>
<body>
<div class="ns-main">
    <div class="options-btn">
        <button class="btn-common" onclick="location.href='{:url(\'admin/freight/index\')}';" style="background: #ccc">返回</button>
        <button class="btn-common" onclick="location.href=' {:url(\'admin/freight/add_freight\',array(\'type\'=>1,\'tpl_id\'=>$param[\'id\']))}';" >配置默认地区</button>
        <button class="btn-common" onclick="location.href=' {:url(\'admin/freight/add_freight\',array(\'type\'=>2,\'tpl_id\'=>$param[\'id\']))}';">添加指定地区</button>

    </div>
    <foreach name="freight_list" item="v">
    <table class="list">
        <colgroup>
            <col style="width: 10%;">
            <col style="width: 20%;">
            <col style="width: 20%;">
            <col style="width: 20%;">
            <col style="width: 20%;">
        </colgroup>
        <tbody>
        <tr class="head">
            <td colspan="6">
                <input type="checkbox" value="1" name="sub" id="1">
                <label for="1">{$v.shipping_fee_name}</label>
                <div>
                    <php>
                        $type=$v['is_whole']==0?1:2;
                    </php>
                    <a href="{:url('admin/freight/edit_freight',array('id'=>$v['shipping_fee_id'],'tpl_id'=>$v['tpl_id'],'tpl_id'=>$v['tpl_id'],'type'=>$type))}">编辑</a>|
                    <a href="{:url('admin/freight/del_freight',array('id'=>$v['shipping_fee_id']))}" class="js-ajax-delete">删除</a>
                </div>
            </td>
        </tr>
        <php>
            $msg="默认全国";
            if($v['is_whole']==1){
                $msg="";
                foreach($v['address_list']['province_list'] as $key1=>$val){
                    $msg=$msg."<h3>".$val['province_name']."</h3><ul>";
                    $i=1;
                    foreach($val['city_list'] as $key2=>$val2){
                         $msg=$msg."<li>".$val2['city_name']."</li>";
                        if($i==count($val['city_list'])){
                             $msg=$msg."</ul>";
                        }
                        $i++;
                    }

                }
            }
        </php>
        <tr class="address">
            <td colspan="6">
                <php>
                    if($v['is_whole']==1){
                </php>
                <foreach name="v['address_list']['province_list']" item="vo">
                    <span>{$vo.province_name}</span>
                </foreach>

                <button data-msg="
                                <header>
						                 <span>{$v.shipping_fee_name}</span><i>x</i>
				                  </header>
				                  <article style='margin-top:40px;overflow: auto;height: 360px;'>
							        	<div>{$msg}</div>
			                      </article>

				">查看详情</button>
                <php>}else{</php>
                默认全国
                <php>}</php>
            </td>
        </tr>

        <tr>
            <td align="center">按件数</td>
            <td class="info">
                <label>首件(件)：</label>
                <span>{$v.bynum_snum}</span>
            </td>
            <td class="info">
                <label>首件运费(元)：</label>
                <span>{$v.bynum_sprice}</span>
            </td>
            <td class="info">
                <label>续件(件)：</label>
                <span>{$v.bynum_xnum}</span>
            </td>
            <td class="info">
                <label>续件运费(元)：</label>
                <span>{$v.bynum_xprice}</span>
            </td>

        </tr>

        <tr>
            <td align="center">按重量</td>
            <td class="info">
                <label>首重(kg)：</label>
                <span>{$v.weight_snum}</span>
            </td>
            <td class="info">
                <label>首重运费(元)：</label>
                <span>{$v.weight_sprice}</span>
            </td>
            <td class="info">
                <label>续重(kg)：</label>
                <span>{$v.weight_xnum}</span>
            </td>
            <td class="info">
                <label>续重运费(元)：</label>
                <span>{$v.weight_xprice}</span>
            </td>

        </tr>

        <tr>
            <td align="center">按体积</td>
            <td class="info">
                <label>首体积量(m³)：</label>
                <span>{$v.volume_snum}</span>
            </td>
            <td class="info">
                <label>首体积运费(元)：</label>
                <span>{$v.volume_sprice}</span>
            </td>
            <td class="info">
                <label>续体积量(m³)：</label>
                <span>{$v.volume_xnum}</span>
            </td>
            <td class="info">
                <label>续体积运费(元)：</label>
                <span>{$v.volume_xprice}</span>
            </td>

        </tr>


        </tbody>
    </table>
    </foreach>
    <script>
        $(function(){
            $(".address button").click(function(){
                $(".mask-layer").show();
                var top = ($(window).height()-$('.mask-address-info').outerHeight())/2;
                var left = ($(window).width()-$('.mask-address-info').outerWidth())/2;
                $(".mask-address-info").html($(this).attr("data-msg")).fadeIn(300);
                $(".mask-address-info").css({ "top" : top, "left" : left });
                $(".mask-address-info header").css({ "top" : top, "left" : left });
            });
            $(".mask-address-info").on("click","header i",function(){
                $(".mask-address-info").fadeOut(300);
                $(".mask-layer").fadeOut(300);
            });
        });
    </script>
    <div class="mask-layer"></div>
    <div class="mask-address-info"></div>

</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
</body>
</html>